package com.yuyou.fn.tms.vo;

import com.yuyou.fn.common.lang.Tuple3;
import com.yuyou.fn.educational.entity.ChargeSetting;
import com.yuyou.fn.platform.entity.City;
import com.yuyou.fn.tms.util.PeriodUtils;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;

/**
 * Created by lzh on 2019/1/31.
 */
public class TmsChargeSetting {
    @ApiModelProperty("段次ID")
    private Long psId ;//段次ID

    @ApiModelProperty("年份")
    private String psYear ;//年份

    @ApiModelProperty("城市ID")
    private Long psCityId ;//城市ID

    @ApiModelProperty("适用的产品类型ID")
    private String psPtsIds ;//适用的产品类型ID

    @ApiModelProperty("用tms的季节id,誉优做mapping")
    private Long psSeasonId ;//用tms的季节id,誉优做mapping

    @ApiModelProperty("状态(0正常,1停用)")
    private double psStatus ;//状态(0正常,1停用)

    @ApiModelProperty("本段收费开始讲次")
    private Integer psSegmentStartNum ;//本段收费开始讲次

    @ApiModelProperty("本段收费结束讲次")
    private Integer psSegmentEndNum ;//本段收费结束讲次

    @ApiModelProperty("收费段次序号，如1,2,3,4")
    private Integer psSegment ;//收费段次序号，如1,2,3,4

    @ApiModelProperty("段次生效开始日期，如‘2018-09-01’")
    private Date psSegmentStartDate ;//段次生效开始日期，如‘2018-09-01’

    @ApiModelProperty("创建时间")
    private Date psCreateTime ;//创建时间

    @ApiModelProperty("修改时间")
    private Date psModifyTime ;//修改时间

    public TmsChargeSetting(ChargeSetting chargeSetting, City city){
        Tuple3<Long, String, String> sea = PeriodUtils.periodName2Sea(chargeSetting.getPeriodName());
        this.setPsId(chargeSetting.getChargeSettingId());//段次ID
        this.setPsYear(sea.getSecond());//年份
        this.setPsCityId(city.getCityId());//城市ID
        this.setPsPtsIds(chargeSetting.getProductIds());//适用的产品类型ID
        this.setPsSeasonId(sea.getFirst());//用tms的季节id,誉优做mapping
        this.setPsStatus(chargeSetting.getStatus()==1?0:1);//状态(0正常,1停用)
        this.setPsSegmentStartNum(chargeSetting.getStartLectureNo());//本段收费开始讲次
        this.setPsSegmentEndNum(chargeSetting.getEndLectureNo());//本段收费结束讲次
        this.setPsSegment(chargeSetting.getChargeSegment());//收费段次序号，如1,2,3,4
        this.setPsSegmentStartDate(chargeSetting.getStartChargeTime());//段次生效开始日期，如‘2018-09-01’
        this.setPsCreateTime(chargeSetting.getCreateTime());//创建时间
        this.setPsModifyTime(chargeSetting.getUpdateTime());//修改时间
    }

    public Long getPsId() {
        return psId;
    }

    public void setPsId(Long psId) {
        this.psId = psId;
    }

    public String getPsYear() {
        return psYear;
    }

    public void setPsYear(String psYear) {
        this.psYear = psYear;
    }

    public Long getPsCityId() {
        return psCityId;
    }

    public void setPsCityId(Long psCityId) {
        this.psCityId = psCityId;
    }

    public String getPsPtsIds() {
        return psPtsIds;
    }

    public void setPsPtsIds(String psPtsIds) {
        this.psPtsIds = psPtsIds;
    }

    public Long getPsSeasonId() {
        return psSeasonId;
    }

    public void setPsSeasonId(Long psSeasonId) {
        this.psSeasonId = psSeasonId;
    }

    public double getPsStatus() {
        return psStatus;
    }

    public void setPsStatus(double psStatus) {
        this.psStatus = psStatus;
    }

    public Integer getPsSegmentStartNum() {
        return psSegmentStartNum;
    }

    public void setPsSegmentStartNum(Integer psSegmentStartNum) {
        this.psSegmentStartNum = psSegmentStartNum;
    }

    public Integer getPsSegmentEndNum() {
        return psSegmentEndNum;
    }

    public void setPsSegmentEndNum(Integer psSegmentEndNum) {
        this.psSegmentEndNum = psSegmentEndNum;
    }

    public Integer getPsSegment() {
        return psSegment;
    }

    public void setPsSegment(Integer psSegment) {
        this.psSegment = psSegment;
    }

    public Date getPsSegmentStartDate() {
        return psSegmentStartDate;
    }

    public void setPsSegmentStartDate(Date psSegmentStartDate) {
        this.psSegmentStartDate = psSegmentStartDate;
    }

    public Date getPsCreateTime() {
        return psCreateTime;
    }

    public void setPsCreateTime(Date psCreateTime) {
        this.psCreateTime = psCreateTime;
    }

    public Date getPsModifyTime() {
        return psModifyTime;
    }

    public void setPsModifyTime(Date psModifyTime) {
        this.psModifyTime = psModifyTime;
    }
}
